layui.use(['form','element','jquery'], function(){
    var form = layui.form;
    var element = layui.element;
    var $ = layui.jquery;



    //删除按钮
    $(".deleteBtn").click(function () {
        var url = $(this).attr("del_url");
        layer.confirm('确定要删除此项?', {icon: 3, title: '提示'}, function (index) {
            //do something
            layer.close(index);
            $("#deleteForm").attr("action", url).submit();

        });
    });


    form.verify({
        requiredI18n: function(value, item){ //value：表单的值、item：表单的DOM对象 a-zA-Z0-9_\u4e00-\u9fa5
           if (value==null||value.length==0){

               return $(item).attr("requiredI18n");
           }
        },
        account: function(value, item){ //value：表单的值、item：表单的DOM对象 a-zA-Z0-9_\u4e00-\u9fa5
            if (!/^[a-zA-Z0-9_\u4e00-\u9fa5]{1,10}$/.test(value)){

                return $(item).attr("account");
            }
        },
        password: function(value, item){ //value：表单的值、item：表单的DOM对象 a-zA-Z0-9_\u4e00-\u9fa5
            if (!/^.{6,18}$/.test(value)){

                return $(item).attr("password");
            }
        }
    });

});